grammar Commands;

format : command '=>' outhandlers ;

outhandlers: outhandler ('=>' outhandler)* ;

outhandler: (command | commands) ;

commands: '{' outhandlers (',' outhandlers)* '}' ;

command : commandname parameters ;

parameters : '(' (parameter (',' parameter)*)? ')' ;

parameter : '@' key '=' value ;

commandname : VARIABLENAME ;

key : VARIABLENAME ;

value : BOOLEAN | INT | STRING ;

BOOLEAN : TRUE | FALSE ;

// parser rules start with lowercase letters, lexer rules with uppercase
INT :   [0-9]+ ;             // Define token INT as one or more digits
VARIABLENAME : [a-zA-Z][a-zA-Z0-9]+ ;
TRUE : 'true' ;
FALSE : 'false' ;
STRING: '"'( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '.' | '_' | '-' | '/' | ',' | ' ' | '\'' | '(' | ')' | ',' | ':' | ';' | '\t' )*'"';
WS  :   [ \t\r\n]+ -> skip ; // Define whitespace rule, toss it out
